
"ui";
var storage = storages.create("qq");

var my_time = storage.get('my_time');
if (my_time == undefined) {
    my_time = '5'
}

var my_content = storage.get('my_content');
if (my_content == undefined) {
    my_content = '验证信息'
}


xml ='<vertical padding="16">\
        <button id="ok" text="开始"/>\
        <text text="音量上键停止运行" textSize="40sp"  gravity="center"/>\
        <horizontal>\
        <text textSize="16sp" textColor="black" text="添加好友间隔时间/秒"/>\
        <input id="my_time" inputType="number" text="' + my_time + '"/>\
        </horizontal>\
        <horizontal>\
        <text textSize="16sp" textColor="black" text="验证信息"/>\
        <input id="my_content" text="' + my_content + '"/>\
        </horizontal>\
    </vertical>'

ui.layout(
    xml
);

//指定确定按钮点击时要执行的动作
ui.ok.click(function(){
    //通过getText()获取输入的内容
    toast("开始辣");
    var my_content = ui.my_content.text();
    var my_time = ui.my_time.text();
    
    storage.put("my_content", my_content);
    storage.put("my_time", parseInt(my_time));

    var path = 'qq添加好友.js'
    execution = engines.execScriptFile(path);
});
